<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <title>酒店后台管理系统</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <link rel="stylesheet" href="css/layui.css"  media="all">
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
  <div class="layui-header">
    <div class="layui-logo">酒店后台管理系统</div>
    <!-- 头部区域（可配合layui已有的水平导航） -->
    <ul class="layui-nav layui-layout-left">
      <li class="layui-nav-item"><a href="">系统设置</a></li>
	  <li class="layui-nav-item"><a href="">订单管理</a></li>
	  <li class="layui-nav-item"><a href="turnover">营业查询</a></li>
    </ul>
    <ul class="layui-nav layui-layout-right">
      <li class="layui-nav-item">
        <a href="javascript:;">
          <img src="http://t.cn/RCzsdCq" class="layui-nav-img">
          贤心
        </a>
        <dl class="layui-nav-child">
          <dd><a href="">基本资料</a></dd>
          <dd><a href="">安全设置</a></dd>
        </dl>
      </li>
      <li class="layui-nav-item"><a href="">退了</a></li>
    </ul>
  </div>
  
  <div class="layui-side layui-bg-black">
    <div class="layui-side-scroll">
      <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
      <ul class="layui-nav layui-nav-tree"  lay-filter="test">
        <li class="layui-nav-item layui-nav-itemed">
          <a class="" href="javascript:;">VIP设置</a>
          <dl class="layui-nav-child">
            <dd><a href="javascript:;">查看VIP</a></dd>
          </dl>
        </li>
        <li class="layui-nav-item">
          <a href="javascript:;">房间设置</a>
          <dl class="layui-nav-child">
            <dd><a href="javascript:;">查看房间</a></dd>
          </dl>
        </li>
		<li class="layui-nav-item">
		  <a href="javascript:;">打折信息设置</a>
		  <dl class="layui-nav-child">
		    <dd><a href="javascript:;">查看打折信息</a></dd>
		  </dl>
		</li>
		<li class="layui-nav-item">
		  <a href="javascript:;">Admin设置</a>
		  <dl class="layui-nav-child">
		    <dd><a href="javascript:;">查看Admin</a></dd>
		  </dl>
		</li>
      </ul>
    </div>
  </div>
  
  <div class="layui-body">
    <!-- 内容主体区域 -->
    <div style="padding: 15px;"> 
<table class="layui-hide" id="test" lay-filter="test"></table>
 
<script type="text/html" id="toolbarDemo">
  <div class="layui-btn-container">
    <button class="layui-btn layui-btn-sm" lay-event="getCheckData">获取选中行数据</button>
    <button class="layui-btn layui-btn-sm" lay-event="getCheckLength">获取选中数目</button>
    <button class="layui-btn layui-btn-sm" lay-event="isAll">验证是否全选</button>
  </div>
</script>
              
          
<script src="js/layui.js" charset="utf-8"></script>
<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 --> 
 
</div>
  </div>
  
  <div class="layui-footer">
    <!-- 底部固定区域 -->
    © layui.com - 底部固定区域
  </div>
</div>
<script src="js/layui.js"></script>
<script>
//JavaScript代码区域
layui.use('element', function(){
  var element = layui.element;
layui.use('table', function(){
  var table = layui.table;
  
  table.render({
    elem: '#test'
    ,url:'/admin/showAdmin',
	parseData:function(res){
		console.log(res);
		return{
			"code":0,
			"msg":"",
			"count":1000,
			"data":res
		}
	},cols: [[
      {field:'uid', title:'ID', width:80, fixed: 'left', unresize: true, sort: true}
      ,{field:'account', title:'用户名', width:120}
      ,{field:'pass', title:'密码', width:120}
      ,{field:'ustate', title:'admin级别', width:120}
    ]]
    ,page: true
  });
  
  //监听行单击事件（单击事件为：rowDouble）
  table.on('row(test)', function(obj){
    var data = obj.data;
    
    layer.alert(JSON.stringify(data), {
      title: '当前行数据：'
    });
    
    //标注选中样式
    obj.tr.addClass('layui-table-click').siblings().removeClass('layui-table-click');
  });
  
});
});
</script>
</body>
</html>